<%@ page import="java.util.ArrayList" %>
<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="utf-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://jsptags.com/tags/navigation/pager" prefix="pg" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%@taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title></title>
    <link href="<%=path%>/CSS/style.css" rel="stylesheet" type="text/css"/>
    <script type="text/javascript" src="<%=path%>/JQuery/jquery-1.8.2.js"></script>
    <%@ include file="/WEB-INF/JSP/ajax.jsp" %>
    <script type="text/javascript" src="<%=path%>/My97DatePicker/WdatePicker.js"></script>
    <style type="text/css">
        .seachform li label {
            line-height: 45px;
            color: #444444
        }

        .scinput {
            line-height: 10px;
            margin-top: 5px
        }

        .scinput1 {
            margin-top: 5px;
            height: 30px;
        }

        .scbtn {
            background: #57a0ff;
            border-radius: 20px;
            width: 110px;
            margin-top: 4px;
            height: 35px
        }

        .scbtn2 {
            height: 20px;
            background: #57a0ff;
            border-radius: 20px;
            width: 50px;
            color: #fff;
            display: none;
        }

        .tablelist {
            border: none;
            margin: 10px 20px
        }

        .tablelist th {
            background: none;
            border-bottom: none;
        }

        thead {
            background: #f2f2f2
        }

        tbody tr:nth-child(even) {
            background: #f7f8fd
        }

        .tablelist th {
            height: 45px;
            padding-left: 30px
        }

        .tablelist td {
            border-right: none;
            padding-left: 30px
        }

        tbody tr {
            height: 38px
        }

        .check {
            padding-left: 0px
        }

        a {
            cursor: pointer;
        }

        .tablelist {
            width: 500px;
            border: 0px;
            border-collapse: collapse;
            border-spacing: 0;
        }

        .tablelist tr {
            height: 30px;
        }

        .tablelist tr td {
            border-bottom: 1px solid #BBB;
        }

        .qx td:nth-child(7) {
            border-right: solid 1px #ccc;
            padding-right: 15px
        }

        .sq a {
            color: #57a0ff
        }

        .table-body {
            bottom: 50px;
        }

        .table-body table tr td {
            width: 30px;
        }

    </style>
</head>
<body style="background: #f5f5f5;padding: 0 10px;">
<div id="location_top">
    <div class="place" style="background: #f5f5f5;margin-top: 10px">
        <ul class="placeul">
            <li><a href="#">财务管理</a></li>
            <li><a href="<%=path%>/DrivingSys/queryTrainCharge/look.action">培训收费</a></li>
        </ul>
    </div>

    <div class="rightinfo" style="background: #fff;border-radius:10px;height: 45px;">

        <form action="<%=path%>/DrivingSys/queryTrainChargeByinfo" method="post">
            <ul class="seachform">
                <li><label>学员</label><input name="studentName" type="text" class="scinput" value="${studentName}"/></li>
                <li><label>身份证号</label><input name="cfidcardno" type="text" class="scinput" value="${cfidcardno}"/></li>
                <li><label>推荐人</label><input name="cftjr" type="text" class="scinput" value="${cftjr}"/></li>
                <li><label>业务开始时间</label><input class="scinput1" name="beginTime" type="text"
                                                onfocus="WdatePicker({maxDate:'#F{$dp.$D(\'datemax\')||\'%y-%M-%d\'}',dateFmt:'yyyy-MM-dd'})"
                                                id="datemin" class="input-text Wdate" style="width:150px;"
                                                value="${beginTime}"></li>
                <li><label>业务结束时间</label><input class="scinput1" name="endTime" type="text"
                                                onfocus="WdatePicker({minDate:'#F{$dp.$D(\'datemin\')}',dateFmt:'yyyy-MM-dd'})"
                                                id="datemax" class="input-text Wdate" style="width:150px;"
                                                value="${endTime}"></li>
                <li><label>&nbsp;</label><input name="" type="submit" class="scbtn" value="立即查询"/></li>
            </ul>
        </form>
    </div>
</div>
<div id="data_table_new"
     style="margin-bottom: 0px;margin-top: 30px;background: #fff;border-radius:10px;box-shadow: 0 0 10px #f2f2f2; min-height: 600px;">
    <ul>
        <li style="height: 40px;text-align: left;color: #999999;">
				  <span style="font-size: 12px;">
				  <shiro:hasPermission name="/insertTrainCharge">
                      <img alt="" style="margin-top: 20px;margin-left: 22px;height: 12px;"
                           src="<%=path%>/images/list/xz.png">
                      &nbsp;<a onclick="gotoSelectCard(this)" funurl="<%=path%>/DrivingSys/insertTrainCharge">新增</a>
                  </shiro:hasPermission>
				  <shiro:hasPermission name="/deleteTranChargeByFid">
                      <img alt="" style="margin-top: 20px;margin-left: 22px;height: 12px;"
                           src="<%=path%>/images/list/sc.png">
                      &nbsp;<a class="del">删除</a>
                  </shiro:hasPermission>
				  <shiro:hasPermission name="/selectTrainChargeByFid">
                      <img alt="" height="11px" src="<%=path%>/images/list/xg.png" style="padding-left: 20px">
                      <a class="modify">修改</a>
                  </shiro:hasPermission>
					  <shiro:hasPermission name="/importTrainCharge">
					  <img alt="" style="margin-top: 20px;margin-left: 22px;height: 12px;width: 14px"
                           src="<%=path%>/images/list/excel.png">
                          <a id="importTrainCharge">导出Excle</a>
                      </shiro:hasPermission>
                     	<a  style="margin-left: 20px">字段筛选：</a>  <select id="ddlLine" class="easyui-combotree" style="width: 205px; height: 24px;"></select>
				  </span>
        </li>
    </ul>
    <table class="tablelist" style="white-space:nowrap;" id="table1">
        <thead>
        <tr class="sq">
            <th><input type="checkbox" class="check2"></th>
            <th>序号</th>
            <th id="1">单据编码</th>
            <th id="2">驾校</th>
            <th id="3">业务日期</th>
            <th id="4">审核人名称</th>
            <th id="5">制单人名称</th>
            <th id="6">单据状态</th>
            <th id="7">学员编码</th>
            <th id="29">入学时间</th>
            <th id="8">学员</th>
            <th id="9">性别</th>
            <th id="10">身份证号</th>
            <th id="11">身份证地址</th>
            <th id="12">推荐人</th>
            <th id="31">推荐人部门</th>
            <th id="30">车型</th>
            <th id="13">班级</th>
            <th id="14">班级金额</th>
            <th id="15">已收</th>
            <th id="16">应收金额</th>
            <th id="17">现金</th>
            <th id="18">刷卡</th>
            <th id="19">实收金额</th>
            <th id="20">优惠金额</th>
            <th id="21">欠费金额</th>
            <th id="22">规费</th>
            <th id="23">培训费</th>
            <th id="24">挂账</th>
            <th id="25">银行转账</th>
            <th id="26">打印次数</th>
            <th id="27">实收培训费</th>
            <th id="28">优惠券</th>
            <th>操作</th>
        </tr>
        </thead>
        <c:forEach items="${trainCharges}" var="trainCharges" varStatus="fustatus">
            <tr><td>${trainChargeEntrys.cfrxsj}</td></tr>
            <!-- 1.1 如果子类集合长度小等于5 则就按子类的长度合并 ===开始=== -->
            <c:if test="${fn:length(trainCharges.trainChargeEntrys) lt 6 }">
                <tr class="qx">
                <td rowspan="${fn:length(trainCharges.trainChargeEntrys) }">
                    <c:if test="${trainCharges.cfbillstate > '3'}">
                        <input type="checkbox" value="${trainCharges.fid}" class="check" disabled="disabled"/>
                    </c:if>
                    <c:if test="${trainCharges.cfbillstate <= '3'}">
                        <input type="checkbox" class="check" name="check" value="${trainCharges.fid}"/>
                    </c:if>
                    <input type="hidden" name="tdlength" value="${fn:length(trainCharges.trainChargeEntrys) }"/>
                </td>
                <td rowspan="${fn:length(trainCharges.trainChargeEntrys) }">${fustatus.index+1}</td>
                <td class="1" rowspan="${fn:length(trainCharges.trainChargeEntrys) }">${trainCharges.fnumber}</td>
                <td class="2" rowspan="${fn:length(trainCharges.trainChargeEntrys) }">${trainCharges.companyName}</td>
                <td class="3" rowspan="${fn:length(trainCharges.trainChargeEntrys) }">${trainCharges.fbizdate}</td>
                <td class="4" rowspan="${fn:length(trainCharges.trainChargeEntrys) }">${trainCharges.shName}</td>
                <td class="5" rowspan="${fn:length(trainCharges.trainChargeEntrys) }">${trainCharges.zdrName}</td>
                <c:if test="${trainCharges.cfbillstate == '4'}">
                    <td class="6" rowspan="${fn:length(trainCharges.trainChargeEntrys) }" class="state">提交</td>
                </c:if>
                <c:if test="${trainCharges.cfbillstate == '5'}">
                    <td class="6" rowspan="${fn:length(trainCharges.trainChargeEntrys) }" class="state">审核</td>
                </c:if>
                <c:if test="${trainCharges.cfbillstate == '3'}">
                    <td class="6" rowspan="${fn:length(trainCharges.trainChargeEntrys) }" class="state">保存</td>
                </c:if>
                <c:if test="${empty trainCharges.cfbillstate}">
                    <td class="6"  rowspan="${fn:length(trainCharges.trainChargeEntrys) }" class="state"></td>
                </c:if>
                <c:forEach items="${trainCharges.trainChargeEntrys}" var="trainChargeEntrys" varStatus="status">
                    <c:if test="${status.first}">
                        <td class="7">${trainChargeEntrys.cfstudentno}</td>
                        <td class="29">${trainChargeEntrys.cfrxsj}</td>
                        <td class="8">${trainChargeEntrys.studentName}</td>
                        <c:if test="${trainChargeEntrys.cfsex == '1'}">
                            <td class="9">男</td>
                        </c:if>
                        <c:if test="${trainChargeEntrys.cfsex == '2'}">
                            <td class="9">女</td>
                        </c:if>
                        <c:if test="${empty trainChargeEntrys.cfsex}">
                            <td></td>
                        </c:if>
                        <td class="10">${trainChargeEntrys.cfidcardno}</td>
                        <td class="11">${trainChargeEntrys.cfidcardaddress}</td>
                        <td class="12">${trainChargeEntrys.cftjr}</td>
                        <td class="31">${trainChargeEntrys.cfdepartment}</td>
                        <td class="30">${trainChargeEntrys.cfslzjcxdh}</td>
                        <td class="13">${trainChargeEntrys.cfclazz}</td>
                        <td class="total_cfclazzamount 14">${trainChargeEntrys.cfclazzamount}</td>
                        <td class="total_cfyishou 15">${trainChargeEntrys.cfyishou}</td>
                        <td class="total_cfysje 16">${trainChargeEntrys.cfysje}</td>
                        <td class="total_cfcash 17">${trainChargeEntrys.cfcash}</td>
                        <td class="total_cfcard 18">${trainChargeEntrys.cfcard}</td>
                        <td class="total_cfshje 19">${trainChargeEntrys.cfshje}</td>
                        <td class="total_cfyhje 20">${trainChargeEntrys.cfyhje}</td>
                        <td class="total_cfqfje 21">${trainChargeEntrys.cfqfje}</td>
                        <td class="total_cfguifei 22">${trainChargeEntrys.cfguifei}</td>
                        <td class="total_cfpxf 23">${trainChargeEntrys.cfpxf}</td>
                        <td class="total_cfguazhang 24">${trainChargeEntrys.cfguazhang}</td>
                        <td class="total_cfyhzz 25">${trainChargeEntrys.cfyhzz}</td>
                        <td class="26">${trainCharges.cfdycs}</td>
                        <td class="total_sspxf 27">${trainChargeEntrys.sspxf}</td>
                        <td class="28">${trainChargeEntrys.cfyhj}</td>
                        <td rowspan="${fn:length(trainCharges.trainChargeEntrys) }">
                            <shiro:hasPermission name="/selectTrainChargeByFid">
                                <img alt="" height="11px" src="<%=path%>/images/list/xg.png">
                                <a href="<%=path%>/DrivingSys/selectTrainChargeByFid?fid=${trainCharges.fid}"
                                   class="tablelink">修改</a>&nbsp;&nbsp;&nbsp;
                            </shiro:hasPermission>
                            <shiro:hasPermission name="/deleteTranChargeByFid">
                                <img alt="" style="margin-top: 20px;margin-left: 22px;height: 12px;"
                                     src="<%=path%>/images/list/sc.png">
                                &nbsp;<a class="delOne" class="tablelink" style="color: #056dae">删除<input type="hidden" value="${trainCharges.fid}"></a>
                                &nbsp;&nbsp;&nbsp;
                            </shiro:hasPermission>
                        </td>
                        </tr>
                    </c:if>
                    <!--1.1.1 跳过第一行打印 ==开始== -->
                    <c:if test="${status.index gt 0  }">
                        <tr>
                            <td style="display: none" id="00"><input type="hidden" class="check" value="${trainCharges.fid}"/>
                            </td>
                            <td class="7">${trainChargeEntrys.cfstudentno}</td>
                            <td class="29">${trainChargeEntrys.cfrxsj}</td>
                            <td class="8">${trainChargeEntrys.studentName}</td>
                            <c:if test="${trainChargeEntrys.cfsex == '1'}">
                                <td class="9">男</td>
                            </c:if>
                            <c:if test="${trainChargeEntrys.cfsex == '2'}">
                                <td class="9">女</td>
                            </c:if>
                            <c:if test="${empty trainChargeEntrys.cfsex}">
                                <td></td>
                            </c:if>
                            <td class="10">${trainChargeEntrys.cfidcardno}</td>
                            <td class="11">${trainChargeEntrys.cfidcardaddress}</td>
                            <td class="12">${trainChargeEntrys.cftjr}</td>
                            <td class="31">${trainChargeEntrys.cfdepartment}</td>
                            <td class="30">${trainChargeEntrys.cfslzjcxdh}</td>
                            <td class="13">${trainChargeEntrys.cfclazz}</td>
                            <td class="total_cfclazzamount 14">${trainChargeEntrys.cfclazzamount}</td>
                            <td class="total_cfyishou 15">${trainChargeEntrys.cfyishou}</td>
                            <td class="total_cfysje 16">${trainChargeEntrys.cfysje}</td>
                            <td class="total_cfcash 17">${trainChargeEntrys.cfcash}</td>
                            <td class="total_cfcard 18">${trainChargeEntrys.cfcard}</td>
                            <td class="total_cfshje 19">${trainChargeEntrys.cfshje}</td>
                            <td class="total_cfyhje 20">${trainChargeEntrys.cfyhje}</td>
                            <td class="total_cfqfje 21">${trainChargeEntrys.cfqfje}</td>
                            <td class="total_cfguifei 22">${trainChargeEntrys.cfguifei}</td>
                            <td class="total_cfpxf 23">${trainChargeEntrys.cfpxf}</td>
                            <td class="total_cfguazhang 24">${trainChargeEntrys.cfguazhang}</td>
                            <td class="total_cfyhzz 25">${trainChargeEntrys.cfyhzz}</td>
                            <td class="26">${trainCharges.cfdycs}</td>
                            <td class="total_sspxf 27">${trainChargeEntrys.sspxf}</td>
                            <td class="28">${trainChargeEntrys.cfyhj}</td>
                        </tr>
                    </c:if>
                    <!--1.1.1 跳过第一行打印 ==结束== -->
                </c:forEach>
            </c:if>
            <!-- 1.1 如果子类集合长度小等于5 则就按子类的长度合并 ===结束=== -->

            <!-- ------------------------------------------------------------------------------------------------------------- -->

            <!--2.1 如果子类集合长度大于5 ===开始=== -->
            <c:if test="${fn:length(trainCharges.trainChargeEntrys) gt 5 }">
                <tr id="hebingfuhang${fustatus.index }" class="qx">
                <td rowspan="6">
                    <c:if test="${trainCharges.cfbillstate > '3'}">
                        <input type="checkbox" value="${trainCharges.fid}" disabled="disabled" class="check"/>
                    </c:if>
                    <c:if test="${trainCharges.cfbillstate <= '3'}">
                        <input type="checkbox" class="check" name="check" value="${trainCharges.fid}"/>
                    </c:if>
                    <input type="hidden" class="fuhang${fustatus.index }" name="tdlength"
                           value="${fn:length(trainCharges.trainChargeEntrys) }"/>
                </td>
                <td rowspan="6">${fustatus.index+1}</td>
                <td class="1" rowspan="6">${trainCharges.fnumber}</td>
                <td class="2" rowspan="6">${trainCharges.companyName}</td>
                <td class="3" rowspan="6">${trainCharges.fbizdate}</td>
                <td class="4" rowspan="6">${trainCharges.shName}</td>
                <td class="5" rowspan="6">${trainCharges.zdrName}</td>
                <c:if test="${trainCharges.cfbillstate == '4'}">
                    <td class="6" rowspan="6" class="state">提交</td>
                </c:if>
                <c:if test="${trainCharges.cfbillstate == '5'}">
                    <td class="6" rowspan="6" class="state">审核</td>
                </c:if>
                <c:if test="${trainCharges.cfbillstate == '3'}">
                    <td class="6" rowspan="6" class="state">保存</td>
                </c:if>
                <c:if test="${empty trainCharges.cfbillstate}">
                    <td class="6" rowspan="6" class="state"></td>
                </c:if>
                <c:forEach items="${trainCharges.trainChargeEntrys}" var="trainChargeEntrys" varStatus="status">
                    <c:if test="${status.first}">
                        <td class="7">${trainChargeEntrys.cfstudentno}</td>
                        <td class="29">${trainChargeEntrys.cfrxsj}</td>
                        <td class="8">${trainChargeEntrys.studentName}</td>
                        <c:if test="${trainChargeEntrys.cfsex == '1'}">
                            <td class="9">男</td>
                        </c:if>
                        <c:if test="${trainChargeEntrys.cfsex == '2'}">
                            <td class="9">女</td>
                        </c:if>
                        <c:if test="${empty trainChargeEntrys.cfsex}">
                            <td class="9"></td>
                        </c:if>
                        <td class="10">${trainChargeEntrys.cfidcardno}</td>
                        <td class="11">${trainChargeEntrys.cfidcardaddress}</td>
                        <td class="12">${trainChargeEntrys.cftjr}</td>
                        <td class="31">${trainChargeEntrys.cfdepartment}</td>
                        <td class="30">${trainChargeEntrys.cfslzjcxdh}</td>
                        <td class="13">${trainChargeEntrys.cfclazz}</td>
                        <td class="total_cfclazzamount 14">${trainChargeEntrys.cfclazzamount}</td>
                        <td class="total_cfyishou 15">${trainChargeEntrys.cfyishou}</td>
                        <td class="total_cfysje 16">${trainChargeEntrys.cfysje}</td>
                        <td class="total_cfcash 17">${trainChargeEntrys.cfcash}</td>
                        <td class="total_cfcard 18">${trainChargeEntrys.cfcard}</td>
                        <td class="total_cfshje 19">${trainChargeEntrys.cfshje}</td>
                        <td class="total_cfyhje 20">${trainChargeEntrys.cfyhje}</td>
                        <td class="total_cfqfje 21">${trainChargeEntrys.cfqfje}</td>
                        <td class="total_cfguifei 22">${trainChargeEntrys.cfguifei}</td>
                        <td class="total_cfpxf 23">${trainChargeEntrys.cfpxf}</td>
                        <td class="total_cfguazhang 24">${trainChargeEntrys.cfguazhang}</td>
                        <td class="total_cfyhzz 25">${trainChargeEntrys.cfyhzz}</td>
                        <td class="26">${trainCharges.cfdycs}</td>
                        <td class="total_sspxf 27">${trainChargeEntrys.sspxf}</td>
                        <td class="28">${trainChargeEntrys.cfyhj}</td>
                        <td rowspan="6">
                            <shiro:hasPermission name="/selectTrainChargeByFid">
                                <img alt="" height="11px" src="<%=path%>/images/list/xg.png">
                                <a href="<%=path%>/DrivingSys/selectTrainChargeByFid?fid=${trainCharges.fid}"
                                   class="tablelink">修改</a>&nbsp;&nbsp;&nbsp;
                            </shiro:hasPermission>
                            <shiro:hasPermission name="/deleteTranChargeByFid">
                                <img alt="" style="margin-top: 20px;margin-left: 22px;height: 12px;"
                                     src="<%=path%>/images/list/sc.png">
                                &nbsp;<a class="delOne" class="tablelink" style="color: #056dae">删除<input type="hidden" value="${trainCharges.fid}"></a>
                                &nbsp;&nbsp;&nbsp;
                            </shiro:hasPermission>
                        </td>
                        </tr>
                    </c:if>
                    <!--2.1.1 跳过第一行打印1至4条的数据 默认显示部分 ==开始== -->
                    <c:if test="${status.index gt 0 and status.index lt 5 }">
                        <tr>
                            <td style="display: none"><input type="hidden" class="check" value="${trainCharges.fid}"/>
                            </td>
                            <td class="7">${trainChargeEntrys.cfstudentno}</td>
                            <td class="29">${trainChargeEntrys.cfrxsj}</td>
                            <td class="8">${trainChargeEntrys.studentName}</td>
                            <c:if test="${trainChargeEntrys.cfsex == '1'}">
                                <td class="9">男</td>
                            </c:if>
                            <c:if test="${trainChargeEntrys.cfsex == '2'}">
                                <td class="9">女</td>
                            </c:if>
                            <c:if test="${empty trainChargeEntrys.cfsex}">
                                <td class="9"></td>
                            </c:if>
                            <td class="10">${trainChargeEntrys.cfidcardno}</td>
                            <td class="11">${trainChargeEntrys.cfidcardaddress}</td>
                            <td class="12">${trainChargeEntrys.cftjr}</td>
                            <td class="31">${trainChargeEntrys.cfdepartment}</td>
                            <td class="30">${trainChargeEntrys.cfslzjcxdh}</td>
                            <td class="13">${trainChargeEntrys.cfclazz}</td>
                            <td class="total_cfclazzamount 14">${trainChargeEntrys.cfclazzamount}</td>
                            <td class="total_cfyishou 15">${trainChargeEntrys.cfyishou}</td>
                            <td class="total_cfysje 16">${trainChargeEntrys.cfysje}</td>
                            <td class="total_cfcash 17">${trainChargeEntrys.cfcash}</td>
                            <td class="total_cfcard 18">${trainChargeEntrys.cfcard}</td>
                            <td class="total_cfshje 19">${trainChargeEntrys.cfshje}</td>
                            <td class="total_cfyhje 20">${trainChargeEntrys.cfyhje}</td>
                            <td class="total_cfqfje 21">${trainChargeEntrys.cfqfje}</td>
                            <td class="total_cfguifei 22">${trainChargeEntrys.cfguifei}</td>
                            <td class="total_cfpxf 23">${trainChargeEntrys.cfpxf}</td>
                            <td class="total_cfguazhang 24">${trainChargeEntrys.cfguazhang}</td>
                            <td class="total_cfyhzz 25">${trainChargeEntrys.cfyhzz}</td>
                            <td class="26">${trainCharges.cfdycs}</td>
                            <td class="total_sspxf 27">${trainChargeEntrys.sspxf}</td>
                            <td class="28">${trainChargeEntrys.cfyhj}</td>
                        </tr>
                    </c:if>
                    <!--2.1.1 跳过第一行打印1至4条的数据 默认显示部分 ==结束== -->

                    <!--2.1.2 打印5至子类长度的数据 隐藏部分 ==开始==-->
                    <c:if test="${status.index gt 4 }">
                        <tr class="fuhang${fustatus.index }" style="display:none">
                            <td style="display: none"><input type="hidden" class="check" value="${trainCharges.fid}"/>
                            </td>

                            <td class="7">${trainChargeEntrys.cfstudentno}</td>
                            <td class="29">${trainChargeEntrys.cfrxsj}</td>
                            <td class="8">${trainChargeEntrys.studentName}</td>
                            <c:if test="${trainChargeEntrys.cfsex == '1'}">
                                <td class="9">男</td>
                            </c:if>
                            <c:if test="${trainChargeEntrys.cfsex == '2'}">
                                <td class="9">女</td>
                            </c:if>
                            <c:if test="${empty trainChargeEntrys.cfsex}">
                                <td class="9"></td>
                            </c:if>
                            <td class="10">${trainChargeEntrys.cfidcardno}</td>
                            <td class="11">${trainChargeEntrys.cfidcardaddress}</td>
                            <td class="12">${trainChargeEntrys.cftjr}</td>
                            <td class="31">${trainChargeEntrys.cfdepartment}</td>
                            <td class="30">${trainChargeEntrys.cfslzjcxdh}</td>
                            <td class="13">${trainChargeEntrys.cfclazz}</td>
                            <td class="total_cfclazzamount 14">${trainChargeEntrys.cfclazzamount}</td>
                            <td class="total_cfyishou 15">${trainChargeEntrys.cfyishou}</td>
                            <td class="total_cfysje 16">${trainChargeEntrys.cfysje}</td>
                            <td class="total_cfcash 17">${trainChargeEntrys.cfcash}</td>
                            <td class="total_cfcard 18">${trainChargeEntrys.cfcard}</td>
                            <td class="total_cfshje 19">${trainChargeEntrys.cfshje}</td>
                            <td class="total_cfyhje 20">${trainChargeEntrys.cfyhje}</td>
                            <td class="total_cfqfje 21">${trainChargeEntrys.cfqfje}</td>
                            <td class="total_cfguifei 22">${trainChargeEntrys.cfguifei}</td>
                            <td class="total_cfpxf 23">${trainChargeEntrys.cfpxf}</td>
                            <td class="total_cfguazhang 24">${trainChargeEntrys.cfguazhang}</td>
                            <td class="total_cfyhzz 25">${trainChargeEntrys.cfyhzz}</td>
                            <td class="26">${trainCharges.cfdycs}</td>
                            <td class="total_sspxf 27">${trainChargeEntrys.sspxf}</td>
                            <td class="28">${trainChargeEntrys.cfyhj}</td>
                        </tr>
                    </c:if>
                    <!--2.1.2 打印5至子类长度的数据 隐藏部分 ==结束== -->

                    <c:if test="${status.last }">
                        <tr id="fuhang${fustatus.index }" class="sq">
                            <td style="display: none"><input type="hidden" class="check" value="${trainCharges.fid}"/>
                            </td>
                            <td style="margin:0 auto;"><a class="showfuhang${fustatus.index }"
                                                          onclick="showdetails($(this));">查看详情</a>
                                <a style="display:none" class="hidefuhang${fustatus.index }"
                                   onclick="hidedetails($(this));">收起详情</a>
                            </td>
                            <td></td>
                            <td></td>
                            <td></td>
                            <td></td>
                            <td></td>
                            <td></td>
                            <td></td>
                            <td></td>
                            <td></td>
                            <td></td>
                            <td></td>
                            <td></td>
                            <td></td>
                            <td></td>
                            <td></td>
                            <td></td>
                            <td></td>
                            <td></td>
                            <td></td>
                            <td></td>
                            <td></td>
                        </tr>
                    </c:if>
                </c:forEach>
            </c:if>
            <!--2.1 如果子类集合长度大于5 ===结束=== -->
        </c:forEach>
        <tr class="sq">
            <td>合计：</td>
            <td>${messageAmount}</td>
            <td class="1"></td>
            <td class="2"></td>
            <td class="3"></td>
            <td class="4"></td>
            <td class="5"></td>
            <td class="6"></td>
            <td class="7"></td>
            <td class="29"></td>
            <td class="8"></td>
            <td class="9"></td>
            <td class="10"></td>
            <td class="11"></td>
            <td class="12"></td>
            <td class="31"></td>
            <td class="30"></td>
            <td class="13"></td>
            <td class="14" id="total_cfclazzamount"></td>
            <td class="15" id="total_cfyishou"></td>
            <td class="16" id="total_cfysje"></td>
            <td class="17" id="total_cfcash"></td>
            <td class="18" id="total_cfcard"></td>
            <td class="19" id="total_cfshje"></td>
            <td class="20" id="total_cfyhje"></td>
            <td class="21" id="total_cfqfje"></td>
            <td class="22" id="total_cfguifei"></td>
            <td class="23" id="total_cfpxf"></td>
            <td class="24" id="total_cfguazhang"></td>
            <td class="25" id="total_cfyhzz"></td>
            <td class="26"></td>
            <td class="27" id="total_sspxf"></td>
            <td class="28"></td>
            <td></td>
        </tr>
    </table>
</div>

<div id="location_bottom">
    <pg:pager items="${pb.tr}" url="${pb.url}" export="offset,currentPageNumber=pageNumber" maxPageItems="${pb.ps}">
        <pg:param name="studentName" value="${studentName}"/>
        <pg:param name="cfidcardno" value="${cfidcardno}"/>
        <pg:param name="cftjr" value="${cftjr}"/>
        <pg:param name="beginTime" value="${beginTime}"/>
        <pg:param name="endTime" value="${endTime}"/>
        <pg:index>
            <pg:first>
                <a href="${pageUrl}&&type=${type}">
                    <nobr>
                        [首页]
                    </nobr>
                </a>
            </pg:first>
            <pg:prev><a href="${pageUrl}&&type=${type}">前一页</a></pg:prev>
            <pg:pages>
                <c:choose>
                    <c:when test="${currentPageNumber eq pageNumber}">
                        <font color="red">${pageNumber }</font>
                    </c:when>
                    <c:otherwise>
                        <a href="${pageUrl}&&type=${type}">${pageNumber}</a>
                    </c:otherwise>
                </c:choose>
            </pg:pages>
            <pg:next><a href="${pageUrl}&&type=${type}">下一页</a></pg:next>
            <pg:last><a href="${pageUrl}&&type=${type}">
                <nobr>[尾页]</nobr>
            </a></pg:last>
        </pg:index>
    </pg:pager>
</div>
<div style="margin-top: 30px"></div>
<div id="tip2"></div>
<div class="tip">
    <div class="tiptop">
        <span>提示信息</span>
    </div>
    <div class="tipinfo">
        <span><img src="<%=path%>/images/ticon.png"/></span>
        <div class="tipright">
            <p>是否确认对信息删除 ？</p>
            <cite>如果是请点击确定按钮 ，否则请点取消。</cite>
        </div>
    </div>
    <div class="tipbtn">
        <input name="" type="button" class="sure" value="确定"/>&nbsp; <input
            name="" type="button" class="cancel" value="取消"/>
    </div>
</div>
</body>
<script type="text/javascript" src="<%=path%>/JS/tempJs/tool.js"></script>
<script type="text/javascript">

    var outs=[];
    $(function () {
        // $(".tip").css("left",$(".tablelist").width()-1000)
        <%
        ArrayList<String>  arr=(ArrayList<String>) request.getSession().getAttribute("trainOutList");
        System.out.println(arr);
        %>
        outs=<%=arr%>;
        if(outs!=null&&outs!=[]){
            showList(outs)
        }
        $('#ddlLine').combotree({
            valueField: "id", //Value字段
            textField: "text", //Text字段
            multiple: true,
            data: [{ "id": 28, "text": "全选", "children": [{ "id": 1, "text": "单据编码" }, { "id": 2, "text": "驾校" },
                    { "id": 3, "text": "业务日期"}, { "id": 4, "text": "审核人名称" }, { "id": 5, "text": "制单人名称" }, { "id": 6, "text": "单据状态" }
                    , { "id": 7, "text": "学员编码" }, { "id": 8, "text": "学员" }, { "id": 9, "text": "性别" }, { "id": 10, "text": "身份证号" }
                    , { "id": 11, "text": "身份证地址" }, { "id": 12, "text": "推荐人" }, { "id": 13, "text": "班级" }, { "id": 14, "text": "班级金额" }
                    , { "id": 15, "text": "已收" }, { "id": 16, "text": "应收金额" }, { "id": 17, "text": "现金" }
                    , { "id": 18, "text": "刷卡" }, { "id": 19, "text": "实收金额" }, { "id": 20, "text": "优惠金额" }
                    , { "id": 21, "text": "欠费金额" }, { "id": 22, "text": "规费" }, { "id": 23, "text": "培训费" }
                    , { "id": 24, "text": "挂账" }, { "id": 25, "text": "银行转账" }, { "id": 26, "text": "打印次数" }
                    , { "id": 27, "text": "实收培训费" }, { "id": 28, "text": "优惠券" }, { "id": 29, "text": "入学时间" },
                    { "id": 30, "text": "车型" }, { "id": 31, "text": "推荐人部门" },
                    ]}]
            ,
            //                url: "tree_data2.json", //数据源
            onCheck: function (node, checked) {
                //让全选不显示
                var valueOne = $('#ddlLine').combotree('getValues');
                var valueTow=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31];
                var flag=true;
                var outl=[];
                for(var i=0;i<valueTow.length;i++){
                    flag=true;
                    for(var j=0;j<valueOne.length;j++){
                        if(valueTow[i]==valueOne[j]){ // 如果数据能保证id和name一直配对，则可以少一个比较条件
                            flag = false;
                            break;
                        }
                    }
                    if(flag){
                        $("#"+valueTow[i]).css("display","none")
                        $("."+valueTow[i]).css("display","none")
                    }else{
                        outl.push(valueTow[i])
                        $("#"+valueTow[i]).css("display","")
                        $("."+valueTow[i]).css("display","")
                    }
                }

                $("#outList").val(outl);
                var obj=new Object();
                obj.outList=outl
                $.ajax({
                    url:'<%=path%>/DrivingSys/trainOutList',
                    data: JSON.stringify(obj),
                    type:"post",
                    dataType:'json',
                    contentType: 'application/json;charset=UTF-8',
                    success: function (res) {
                    }

                })
                console.log(outl)
                $("#ddlLine").combotree("setText", $("#ddlLine").combobox("getText").toString().replace("全选,", ""));
            },
            onClick: function (node, checked) {
                //让全选不显示
                $("#ddlLine").combotree("setText", $("#ddlLine").combobox("getText").toString().replace("全选,", ""));
            }
        });
    })


    //记住筛选的字段
    function showList(outs){
        var valueOne =outs;
        var valueTow=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31];
        var flag=true;
        for(var i=0;i<valueTow.length;i++){
            flag=true;
            for(var j=0;j<valueOne.length;j++){
                if(valueTow[i]==valueOne[j]){ // 如果数据能保证id和name一直配对，则可以少一个比较条件
                    flag = false;
                    break;
                }
            }
            if(flag){
                $("#"+valueTow[i]).css("display","none")
                $("."+valueTow[i]).css("display","none")
            }else{
                $("#"+valueTow[i]).css("display","")
                $("."+valueTow[i]).css("display","")
            }
        }

    }



    //初始化加载合计
    $(function () {
        $('#total_cfclazzamount').text(class_sum('.total_cfclazzamount'));
        $('#total_cfyishou').text(class_sum('.total_cfyishou'));
        $('#total_cfysje').text(class_sum('.total_cfysje'));
        $('#total_cfcash').text(class_sum('.total_cfcash'));
        $('#total_cfcard').text(class_sum('.total_cfcard'));
        $('#total_cfshje').text(class_sum('.total_cfshje'));
        $('#total_cfyhje').text(class_sum('.total_cfyhje'));
        $('#total_cfqfje').text(class_sum('.total_cfqfje'));
        $('#total_cfguifei').text(class_sum('.total_cfguifei'));
        $('#total_cfpxf').text(class_sum('.total_cfpxf'));
        $('#total_cfguazhang').text(class_sum('.total_cfguazhang'));
        $('#total_cfyhzz').text(class_sum('.total_cfyhzz'));
        $('#total_sspxf').text(class_sum('.total_sspxf'));
    });


    //显示
    function showdetails(obj) {
        var row = $(obj).parent().parent().prop("id")
        //隐藏点击查看更多
        $(".show" + row).hide()
        //显示点击收起详情
        $(".hide" + row).show()
        //显示数据详情
        $("." + row).show()
        var hebingshu = $("#hebing" + row + " input:hidden[name=tdlength]").val()
        hebingshu = Number(hebingshu)
        hebingshu += 1
        $("#hebing" + row).find("td").eq(0).attr("Rowspan", hebingshu)
        $("#hebing" + row).find("td").eq(1).attr("Rowspan", hebingshu)
        $("#hebing" + row).find("td").eq(2).attr("Rowspan", hebingshu)
        $("#hebing" + row).find("td").eq(3).attr("Rowspan", hebingshu)
        $("#hebing" + row).find("td").eq(4).attr("Rowspan", hebingshu)
        $("#hebing" + row).find("td").eq(5).attr("Rowspan", hebingshu)
        $("#hebing" + row).find("td").eq(6).attr("Rowspan", hebingshu)
        $("#hebing" + row).find("td").eq(7).attr("Rowspan", hebingshu)
        $("#hebing" + row).find("td:last").attr("Rowspan", hebingshu)
    }


    //隐藏
    function hidedetails(obj) {
        var row = obj.parent().parent().prop("id")
        //显示点击查看更多
        $(".show" + row).show()
        //隐藏点击收起详情
        $(".hide" + row).hide()
        //隐藏大于5条的数据
        $("." + row).hide()
        //合并行改成只显示之前的5条加一条点击查看更多tr
        $("#hebing" + row).find("td").eq(0).attr("Rowspan", 6)
        $("#hebing" + row).find("td").eq(1).attr("Rowspan", 6)
        $("#hebing" + row).find("td").eq(2).attr("Rowspan", 6)
        $("#hebing" + row).find("td").eq(3).attr("Rowspan", 6)
        $("#hebing" + row).find("td").eq(4).attr("Rowspan", 6)
        $("#hebing" + row).find("td").eq(5).attr("Rowspan", 6)
        $("#hebing" + row).find("td").eq(6).attr("Rowspan", 6)
        $("#hebing" + row).find("td:last").attr("Rowspan", 6)

    }


    $(document).ready(function () {
        var flag = "${flag}"
        if (flag == 4) {
            editAlert();
        }

        fixation_List()


        //删除多个
        $('.del').click(function () {
            var sq = $("input[name='check']").is(":checked");
            if (sq == false) {
                alert("请至少选择一条数据删除")
            } else {
                $("#tip2").css('visibility', 'visible');
                $(".tip").fadeIn(200);
            }
            $(".sure").unbind("click").click(function () {
                var str = new Array();
                var fnumber = new Array();
                var s = '0';
                $("input[name='check']:checked").each(function (i) {
                    var state = $(this).parent().parent().find(".state").text();
                    if (state == "提交" || state == "审核") {
                        s = '1';
                        return false
                    } else {
                        str[i] = $(this).val();
                        fnumber[i] = $(this).parent().next().text();
                    }
                })
                if (s == '1') {
                    alert("提交或审核状态不能被删除")
                    $(".tip").fadeOut(100);
                    $("#tip2").css('visibility', 'hidden');
                } else {
                    location = '<%=path%>/DrivingSys/deleteTranChargeByFid?deleteId=' + str + '&fnumber=' + fnumber;
                }
            })

            $(".cancel").click(function () {
                $(".tip").fadeOut(100);
                $("#tip2").css('visibility', 'hidden');
            });
        })
        //删除单个
        $('.delOne').click(function () {
            var fid = $(this).find("input:hidden").val();
            var state = $(this).parent().parent().find(".state").text();
            var fnumber2 = $(this).parent().parent().find("td").eq(1).text();
            if (state == "提交" || state == "审核") {
                alert("提交或审核状态不能被删除")
            } else {
                $(".tip").animate(({top: $(window).scrollTop()+250}))
                $("#tip2").css('visibility', 'visible');
                $(".tip").fadeIn(200);
            }
            $(".sure").unbind("click").click(function () {
                location = '<%=path%>/DrivingSys/deleteTranChargeByFid?fid=' + fid + '&fnumber2=' + fnumber2;
            })

            $(".cancel").click(function () {
                $(".tip").fadeOut(100);
                $("#tip2").css('visibility', 'hidden');
            });
        })

        //修改
        $(".modify").click(function () {
            var stringFid;
            var fids = document.getElementsByName("check");
            for (var i = 0; i < fids.length; i++) {
                if (fids[i].checked) {
                    stringFid = fids[i].value;
                    location = '<%=path%>/DrivingSys/selectTrainChargeByFid?fid=' + stringFid + '';
                    return false
                }
            }
            if (stringFid == null || stringFid.length == 0) {
                alert("请至少选择一条数据修改")
                return false
            }
        })
        //查询详情
        $("tr:not(.sq)").dblclick(function () {
            var fid2 = $(this).find(".check").val();
            //避免fid中有+，或者特殊字符
            var fid = encodeURI(fid2).replace(/\+/g, '%2B')
            gotoSelectCard(this,'/DrivingSys/selectTrainChargeByFid?fid='+fid);
            //location = '<%=path%>/DrivingSys/selectTrainChargeByFid?fid=' + fid + '';
        })
    })
    //设置全选功选
    $('.check2').click(function () {
        if ($(this).attr("checked")) {
            $("input[name='check']").prop("checked", true)
        } else {
            $("input[name='check']").removeAttr('checked')
        }
    })

    //导出
    $("#importTrainCharge").click(function () {
        var studentName = $("input[name='studentName']").val();//学员
        var cfidcardno = $("input[name='cfidcardno']").val();//身份证号
        var cftjr = $("input[name='cftjr']").val();//推荐人
        var beginTime = $("input[name='beginTime']").val();//开始时间
        var endTime = $("input[name='endTime']").val();//结束时间
        location = '<%=path%>/DrivingSys/importTrainCharge?studentName=' + studentName + '&cfidcardno=' + cfidcardno + '&cftjr=' + cftjr + '&beginTime=' + beginTime + '&endTime=' + endTime
    })

</script>
</html>